﻿using System;

namespace _04责任链模式
{
    /// <summary>
    /// 最高领导(三级)
    /// </summary>
    public class LeaderHandler3 : AbstractHandler
    {
        /// <summary>
        /// 处理请假请求
        /// </summary>
        public override void HandleRequest(LeaveRequest request)
        {
            if (request.leaveDays > 7 && request.leaveDays <= 30)
            {
                Console.WriteLine($"最高领导(三级)已经批准{request.name}的请假请求,请假天数：{request.leaveDays}");
            }
            else
            {
                if (this.NextHandler != null)
                {
                    this.NextHandler.HandleRequest(request);
                }
                else
                {
                    Console.WriteLine($"{request.name}请假天数太多，没有人批准该假条！");
                }
            }

        }
    }
}
